//
//  SearchViewController.m
//  42centerTwo
//
//  Created by dragon on 15/10/31.
//  Copyright © 2015年 dragon. All rights reserved.
//

#import "SearchViewController.h"

@interface SearchViewController ()
@property (strong,nonatomic) UIButton *button;
@property (strong,nonatomic) UISearchBar *searchBar;
@end

@implementation SearchViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _channelViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"channelViewController"];
    _button = [[UIButton alloc] initWithFrame:CGRectMake(self.view.frame.size.width-self.view.frame.size.width/7, self.view.frame.size.height/24, 46, 30)];
    _button.backgroundColor = [UIColor whiteColor];
    [_button setTitle:@"返回" forState:UIControlStateNormal];//按钮文字
    [_button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];//按钮文字颜色
    [_button addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:_button];
    
    
    
    _searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, self.view.frame.size.height/8, self.view.frame.size.width, self.view.frame.size.height/16)];
    _searchBar.backgroundColor = [UIColor grayColor];
    [self.view addSubview:_searchBar];

    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


-(void)buttonAction :(id)sender{
    [_button isSelected];
    [_button setTitleColor:[UIColor redColor] forState:UIControlStateHighlighted];
    [self dismissViewControllerAnimated:YES completion:nil]; //返回上次跳转回来的界面
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
